<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阻止表单提交</title>
</head>

<body>
    <form action="http://www.ekgc.cn/member/elogin" method="post">
        <input type="text" name="KgcForm_models_LoginForm[identity]" value="18515697037" id="account">
        <input type="password" name="KgcForm_models_LoginForm[password]" value="e10adc3949ba59abbe56e057f20f883e" id="password">
        <input id="submit" type="submit" value="登录"><span id="msg" style="display: none; color: red;"></span>
    </form>


</body>

</html>
<script>
    let submit = window.document.querySelector('#submit');
    let account = window.document.querySelector('#account');
    let password = window.document.querySelector('#password');
    let msg = window.document.querySelector('#msg');
    // submit.onclick = function check(params) {
    //     return false;
    // }
    submit.addEventListener('click', function(e) {
        e.preventDefault();
        window.console.log('帐号' + account.value);
        window.console.log('密码' + password.value);
        msg.innerText = '帐号或者密码错误';
        msg.style.display = 'block';
        password.value = '';
        password.onfocus = function(param) {};
    });
</script>